var gulp = require('gulp')
var gulpShell = require('gulp-shell')
/**
 * 账号：lihao
 * 密码：lihao986
 */
var config = {
  connectUrl: '\\\\192.168.10.110\\ipc$',
  userName: 'lihao',
  password: 'lihao986',
  comUrl: '//192.168.10.110/org', // 测试服地址
  devUrl: '//192.168.10.110/devorg', // 开发服地址
  testUrl: '//192.168.10.110/lihao/tyler'
}
gulp.task('connect', gulpShell.task('net use '+ config.connectUrl +' '+ config.password +' /user:'+ config.userName))

gulp.task('copy', function (cb) {
  return gulp.src('./static/**')
    .pipe(gulp.dest('./dist/static'))
})

// 上传测试服
gulp.task('upload:com', ['connect'], function () {
  return gulp.src(['./dist/**'])
    .pipe(gulp.dest(config.comUrl))
})

// 上传开发服
gulp.task('upload:dev', ['connect'], function () {
  return gulp.src(['./dist/**'])
    .pipe(gulp.dest(config.devUrl))
})

// 测试上传
gulp.task('upload:test', ['connect'], function () {
  return gulp.src(['./dist/**'])
    .pipe(gulp.dest(config.testUrl))
})
